var form = $('.bot')
// console.log(form);
form.submit(function (e) {
    e.preventDefault()
    var fd = $('form').serialize();
    // console.log(fd); username=admin&password=admin
    // 验证用户名或者密码是否正确
    $.ajax({
        type: 'post',
        url: 'http://localhost:8888/api/login',
        // username: fd.username,
        // password: fd.password,
        data: fd,
        success: function (res) {
            console.log(res);
            if (res.status === 0) {
                localStorage.setItem('token', res.token);
                location.href = './index.html'
            } else if (res.status === 1) {
                localStorage.removeItem('token');
                location.href = './login.html'
            }

        }
    })
})